CollectSourceFiles(${CMAKE_CURRENT_SOURCE_DIR} PRIVATE_SOURCES)
ADD_DEFINITIONS(-DUNICODE -D_UNICODE -DNANODBC_ENABLE_UNICODE)

GroupSources(${CMAKE_CURRENT_SOURCE_DIR})
CollectIncludeDirectories( ${CMAKE_CURRENT_SOURCE_DIR} PUBLIC_INCLUDES)

ADD_EXECUTABLE(XStock  WIN32 ${PRIVATE_SOURCES})

target_link_libraries(XStock PRIVATE emoney-core-interface PUBLIC base soui cpr libcurl delayimp.lib XCommon sqlitecpp)
target_include_directories(XStock PRIVATE  ${PUBLIC_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR})

set_property(TARGET XStock PROPERTY VS_DPI_AWARE "OFF")
set_target_properties(XStock PROPERTIES FOLDER "apps")
set_property(TARGET XStock PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")

add_custom_command(TARGET XStock
        PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/xstock/theme)

add_custom_command(TARGET XStock
        PRE_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory  ${CMAKE_CURRENT_SOURCE_DIR}/xstock/theme/ ${CMAKE_BINARY_DIR}/bin/$(ConfigurationName)/xstock/theme )     